// pages/category/category.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentTab: 0,
    categorys: [{
        id: 1,
        name: "男装女装"
      },
      {
        id: 2,
        name: "男鞋女鞋"
      },
      {
        id: 3,
        name: "内衣配饰"
      },
      {
        id: 4,
        name: "手表首饰"
      },
      {
        id: 5,
        name: "家用电器"
      },
      {
        id: 6,
        name: "电脑办公"
      },
      {
        id: 7,
        name: "美妆护理"
      },
      {
        id: 8,
        name: "手机数码"
      }
    ],
    products: [
      [{
          name: "热卖选购",
          sub: [{
              name: "时尚羽绒",
              url: "https://img13.360buyimg.com/focus/jfs/t13111/296/562407882/5437/708e24a6/5a0ebc62Nec865e68.jpg",
              cid: 1
            },
            {
              name: "保暖棉服",
              url: "https://img30.360buyimg.com/focus/jfs/t13912/250/565576531/4969/64afff47/5a0ebc5cNe2bddf32.jpg",
              cid: 2
            },
            {
              name: "修身夹克",
              url: "https://img11.360buyimg.com/focus/jfs/t12559/159/597184401/2349/d2e74b56/5a0ebc54N07bbacf3.jpg",
              cid: 1
            },
            {
              name: "牛仔裤",
              url: "https://img20.360buyimg.com/focus/jfs/t11629/115/2055948200/3740/55436dda/5a0ebc4eN9436e96b.jpg",
              cid: 1
            },
            {
              name: "加厚牛仔",
              url: "https://img11.360buyimg.com/focus/jfs/t13936/183/588130813/8839/9813c67b/5a0e7d9dNbe49c231.jpg",
              cid: 1
            },
            {
              name: "宽松卫衣",
              url: "https://img10.360buyimg.com/focus/jfs/t12772/63/745865953/4030/e85071ec/5a12b220N009d72a4.jpg",
              cid: 1
            },
            {
              name: "连衣裙",
              url: "https://img12.360buyimg.com/focus/jfs/t12346/326/736792997/3041/8c591fbc/5a1284e4N5f6ac63d.jpg",
              cid: 2
            },
            {
              name: "婚纱",
              url: "https://img11.360buyimg.com/focus/jfs/t11296/167/2160342769/2309/f04ca6ca/5a126a5aN99085a6b.jpg",
              cid: 1
            }
          ]
        },
        {
          name: "女装",
          sub: [{
              name: "新款大衣",
              url: "https://img10.360buyimg.com/focus/jfs/t13465/116/726666318/2650/623a7359/5a12b23eNbc0d7a47.jpg",
              cid: 1
            },
            {
              name: "连衣裙",
              url: "https://img20.360buyimg.com/focus/jfs/t14179/99/752605750/2297/f82b2e3d/5a12b234N2259963f.jpg",
              cid: 2
            },
            {
              name: "针织衫",
              url: "https://img30.360buyimg.com/focus/jfs/t11794/114/2228059199/2529/60e8b474/5a12b21eN10fd877c.jpg",
              cid: 1
            },
            {
              name: "毛衣",
              url: "https://img30.360buyimg.com/focus/jfs/t13516/94/713391824/4978/97513273/5a12b228Nf46f2ff1.jpg",
              cid: 1
            },
            {
              name: "宽松卫衣",
              url: "https://img10.360buyimg.com/focus/jfs/t12772/63/745865953/4030/e85071ec/5a12b220N009d72a4.jpg",
              cid: 1
            },
            {
              name: "外套",
              url: "https://img13.360buyimg.com/focus/jfs/t13774/60/747129929/2709/b436419d/5a12b217N8470eba0.jpg",
              cid: 1
            },
            {
              name: "阔腿裤",
              url: "https://img12.360buyimg.com/focus/jfs/t12409/127/746361250/2852/a7e2c78f/5a12b214Na8e5f494.jpg",
              cid: 2
            },
            {
              name: "婚纱",
              url: "https://img11.360buyimg.com/focus/jfs/t11296/167/2160342769/2309/f04ca6ca/5a126a5aN99085a6b.jpg",
              cid: 1
            }
          ]
        },
        {
          name: "童装",
          sub: [{
              name: "品质童装",
              url: "https://img12.360buyimg.com/focus/jfs/t11257/255/2211172737/8332/3ef32977/5a12448aN04e0b987.jpg",
              cid: 1
            },
            {
              name: "套装",
              url: "https://img12.360buyimg.com/focus/jfs/t12442/247/704086578/7163/f0b3677d/5a12447fNd3894b27.jpg",
              cid: 1
            },
            {
              name: "裙子",
              url: "https://img10.360buyimg.com/focus/jfs/t13756/13/712950885/7910/6346b45/5a124475Nb3b9efd6.jpg",
              cid: 2
            },
            {
              name: "亲子装",
              url: "https://img12.360buyimg.com/focus/jfs/t11635/258/2210764394/12510/66bd58cf/5a12445bN917f40bb.jpg",
              cid: 1
            }
          ]
        }
      ],
      [{
          name: "流行男鞋",
          sub: [{
              name: "休闲鞋",
              url: "https://img14.360buyimg.com/focus/jfs/t13807/314/786063079/2610/c0e7de7b/5a139490Nc7fa0e4a.jpg",
              cid: 1
            },
            {
              name: "商务鞋",
              url: "https://img30.360buyimg.com/focus/jfs/t13138/355/835254734/2223/adb0cd95/5a139489N23c871c6.jpg",
              cid: 2
            },
            {
              name: "正装鞋",
              url: "https://img20.360buyimg.com/focus/jfs/t13552/146/765573445/2431/4311417d/5a13947dN5d024b9f.jpg",
              cid: 1
            },
            {
              name: "帆布鞋",
              url: "https://img30.360buyimg.com/focus/jfs/t11992/144/2244194535/2627/3de251a9/5a139564Naee94e4a.jpg",
              cid: 1
            },
            {
              name: "板鞋",
              url: "https://img20.360buyimg.com/focus/jfs/t11608/19/2161730920/5152/2fca75c0/5a13945cN82a4c505.jpg",
              cid: 1
            },
            {
              name: "乐福鞋",
              url: "https://img11.360buyimg.com/focus/jfs/t13036/184/750618513/5315/27749ec8/5a13945aN0c00392c.jpg",
              cid: 1
            },
            {
              name: "拖鞋",
              url: "https://img20.360buyimg.com/focus/jfs/t13234/118/798001202/2581/6e6cc64d/5a139429N8c5c158d.jpg",
              cid: 2
            },
            {
              name: "传统布鞋",
              url: "https://img14.360buyimg.com/focus/jfs/t11803/345/2212661587/2218/85b38b81/5a139422N611a859c.jpg",
              cid: 1
            },
            {
              name: "凉鞋",
              url: "https://img10.360buyimg.com/focus/jfs/t11824/310/2093755858/3582/469cedf4/5a139411N2cd65a08.jpg",
              cid: 1
            }
          ]
        },
        {
          name: "时尚女鞋",
          sub: [{
              name: "休闲鞋",
              url: "https://img12.360buyimg.com/focus/jfs/t11215/28/2255245076/2123/34893220/5a13f4c2N878e06ff.jpg",
              cid: 1
            },
            {
              name: "女鞋",
              url: "https://img11.360buyimg.com/focus/jfs/t12391/56/793656945/6443/8dd29335/5a13f4bbN0109307e.jpg",
              cid: 2
            },
            {
              name: "短靴",
              url: "https://img12.360buyimg.com/focus/jfs/t14071/40/787831338/2452/708b727c/5a13f4b4Ndd40587a.jpg",
              cid: 1
            },
            {
              name: "马丁靴",
              url: "https://img30.360buyimg.com/focus/jfs/t12115/73/819992685/2931/f6dd612a/5a13f4adN0116fe8b.jpg",
              cid: 1
            },
            {
              name: "帆布鞋",
              url: "https://img14.360buyimg.com/focus/jfs/t13090/47/771516189/4149/4e90042d/5a13f4a2Ndab62821.jpg",
              cid: 1
            },
            {
              name: "高跟鞋",
              url: "https://img20.360buyimg.com/focus/jfs/t11425/144/2240698284/6302/25994392/5a13f483Nf8bfdc2a.jpg",
              cid: 1
            },
            {
              name: "通勤OL",
              url: "https://img12.360buyimg.com/focus/jfs/t14173/278/783151079/2583/827febf/5a13f446N1df58a24.jpg",
              cid: 2
            },
            {
              name: "凉鞋",
              url: "https://img30.360buyimg.com/focus/jfs/t12202/143/797781605/8338/ffe87737/5a13f437N94b74f9e.jpg",
              cid: 1
            }
          ]
        }
      ],
      [{
          name: "保暖内衣",
          sub: [{
              name: "保暖内衣",
              url: "https://img30.360buyimg.com/focus/jfs/t11665/278/2197383506/8742/b3a23c67/5a151d25N2927b937.jpg",
              cid: 1
            },
            {
              name: "保暖裤",
              url: "https://img10.360buyimg.com/focus/jfs/t14194/47/842495430/4074/ecf95595/5a151c9fNcbf87576.jpg",
              cid: 2
            },
            {
              name: "男士保暖",
              url: "https://img10.360buyimg.com/focus/jfs/t13972/34/849982121/5216/58243ee9/5a151c97Nf6982faf.jpg",
              cid: 1
            },
            {
              name: "女士保暖",
              url: "https://img30.360buyimg.com/focus/jfs/t12475/176/848778869/6374/6375ca3d/5a151c91N7eb33b8a.jpg",
              cid: 1
            },
            {
              name: "保暖套装",
              url: "https://img13.360buyimg.com/focus/jfs/t11809/296/2163842896/4546/352b9a6e/5a151c8bN96fecb7e.jpg",
              cid: 1
            },
            {
              name: "秋衣秋裤",
              url: "https://img20.360buyimg.com/focus/jfs/t7399/70/3104753877/8744/76f4c985/5a151c86Na4d59a6e.jpg",
              cid: 1
            },
            {
              name: "薄款保暖",
              url: "https://img11.360buyimg.com/focus/jfs/t13735/32/849000445/5947/960b5ef2/5a151c7fNbc7f4c1e.jpg",
              cid: 2
            }
          ]
        },
        {
          name: "大牌文胸",
          sub: [{
              name: "文胸",
              url: "https://img14.360buyimg.com/focus/jfs/t13378/250/854666186/6239/1bf559e7/5a151a72N53143ccc.jpg",
              cid: 1
            },
            {
              name: "文胸套装",
              url: "https://img10.360buyimg.com/focus/jfs/t12130/124/832696896/5911/f4d2344a/5a151a6cNdc177f6d.jpg",
              cid: 2
            },
            {
              name: "光面文胸",
              url: "https://img10.360buyimg.com/focus/jfs/t11482/131/2311710162/3140/d8fde417/5a151a65N45b485d1.jpg",
              cid: 1
            },
            {
              name: "少女文胸",
              url: "https://img14.360buyimg.com/focus/jfs/t13594/205/852318080/7617/582aed75/5a151a5fN25aee58e.jpg",
              cid: 1
            },
            {
              name: "大码文胸",
              url: "https://img11.360buyimg.com/focus/jfs/t13153/305/851394568/6118/1820a06f/5a151a59Nbdabaca6.jpg",
              cid: 1
            },
            {
              name: "薄杯文胸",
              url: "https://img10.360buyimg.com/focus/jfs/t11308/327/2313435108/3168/9d291152/5a151a53Nae33f47f.jpg",
              cid: 1
            }
          ]
        },
        {
          name: "睡衣",
          sub: [{
              name: "女士睡衣",
              url: "https://img10.360buyimg.com/focus/jfs/t11005/3/2304642911/8385/a71450ca/5a151858N4be1dc0d.jpg",
              cid: 1
            },
            {
              name: "男士睡衣",
              url: "https://img13.360buyimg.com/focus/jfs/t12541/211/823596303/8968/f7a77219/5a151865N76835f4e.jpg",
              cid: 2
            },
            {
              name: "情侣睡衣",
              url: "https://img12.360buyimg.com/focus/jfs/t11329/12/1836956333/9157/98620256/5a151865N6a6fad17.jpg",
              cid: 1
            },
            {
              name: "全棉睡衣",
              url: "https://img30.360buyimg.com/focus/jfs/t13192/199/867844884/7586/76e77fe9/5a151856N09b4ab99.jpg",
              cid: 1
            },
            {
              name: "珊瑚绒睡衣",
              url: "https://img13.360buyimg.com/focus/jfs/t11587/21/2313014983/9146/861f5dae/5a151829Nfecff630.jpg",
              cid: 1
            },
            {
              name: "睡裙",
              url: "https://img10.360buyimg.com/focus/jfs/t11851/285/2297627074/5910/155cdfa4/5a1517c4N4ac20e25.jpg",
              cid: 1
            },
            {
              name: "睡袍",
              url: "https://img20.360buyimg.com/focus/jfs/t12130/215/855565191/6525/9839c527/5a1517c9N65f06d53.jpg",
              cid: 1
            },
            {
              name: "真丝睡衣",
              url: "https://img14.360buyimg.com/focus/jfs/t11551/3/2267920652/11096/40692555/5a151679Ne7ced42c.png",
              cid: 1
            }
          ]
        }
      ]
    ]
  },
  switchNav: function(e) {
    var that = this;
    if (that.data.currentTab === e.currentTarget.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.currentTarget.dataset.current
      })
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})